home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / amigaunits / translator.pas < prev    next >
Pascal/Delphi Source File  |  2000-01-01  |  1KB  |  50 lines

  1. {
  2.     This file is part of the Free Pascal run time library.
  3.  
  4.     A file in Amiga system run time library.
  5.     Copyright (c) 1998-2000 by Nils Sjoholm
  6.     member of the Amiga RTL development team.
  7.  
  8.     See the file COPYING.FPC, included in this distribution,
  9.     for details about the copyright.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14.  
  15.  **********************************************************************}
  16.  
  17. UNIT translator;
  18.  
  19. INTERFACE
  20. USES exec;
  21.  
  22. Const
  23.  
  24.     TR_NotUsed          = -1;   { This is an oft used system rc }
  25.     TR_NoMem            = -2;   { Can't allocate memory }
  26.     TR_MakeBad          = -4;   { Error in MakeLibrary call }
  27.  
  28. VAR TranslatorBase : pLibrary;
  29.  
  30. FUNCTION Translate(inputString : pCHAR; inputLength : LONGINT; outputBuffer : pCHAR; bufferSize : LONGINT) : LONGINT;
  31.  
  32. IMPLEMENTATION
  33.  
  34. FUNCTION Translate(inputString : pCHAR; inputLength : LONGINT; outputBuffer : pCHAR; bufferSize : LONGINT) : LONGINT;
  35. BEGIN
  36.   ASM
  37.     MOVE.L  A6,-(A7)
  38.     MOVEA.L inputString,A0
  39.     MOVE.L  inputLength,D0
  40.     MOVEA.L outputBuffer,A1
  41.     MOVE.L  bufferSize,D1
  42.     MOVEA.L TranslatorBase,A6
  43.     JSR -030(A6)
  44.     MOVEA.L (A7)+,A6
  45.     MOVE.L  D0,@RESULT
  46.   END;
  47. END;
  48.  
  49. END. (* UNIT TRANSLATOR *)
  50.